
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace CauBeTimMe.utils
{
    public class ImageHelper
    {
        public static Texture2D LoadImage(String file)
        {
            try
            {
                Stream fs = TitleContainer.OpenStream(file);
                Texture2D img = Texture2D.FromStream(Main.getInstance().GraphicsDevice, fs);
                fs.Close();
                fs = null;

                return img;
            }
            catch (Exception e)
            {
                // Handle error
                return null;
            }
        }
    }
}
